Skip to content

Commit eea9f73

Browse files
Murali Karicheridavem330
authored andcommitted
net: hsr: validate address B before copying to skb
Validate MAC address before copying the same to outgoing frame skb destination address. Since a node can have zero mac address for Link B until a valid frame is received over that link, this fix address the issue of a zero MAC address being in the packet. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6d6148b commit eea9f73

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/hsr/hsr_framereg.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
325325
if (port->type != node_dst->addr_B_port)
326326
return;
327327

328-
ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B);
328+
if (is_valid_ether_addr(node_dst->macaddress_B))
329+
ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B);
329330
}
330331

331332
void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port,

0 commit comments

Comments
 (0)