]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/qeth: handle limited IPv4 broadcast in L3 TX path
authorJulian Wiedmann <jwi@linux.ibm.com>
Wed, 5 Jun 2019 11:48:48 +0000 (13:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jun 2019 03:34:52 +0000 (11:34 +0800)
[ Upstream commit 72c87976c5abbf8a834ad85f10d03c0cd58b985c ]

When selecting the cast type of a neighbourless IPv4 skb (eg. on a raw
socket), qeth_l3 falls back to the packet's destination IP address.
For this case we should classify traffic sent to 255.255.255.255 as
broadcast.
This fixes DHCP requests, which were misclassified as unicast
(and for IQD interfaces thus ended up on the wrong HW queue).

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/net/qeth_l3_main.c

index 53712cf2640659cb0da642ba1dc05bb03e6567ec..cb641fd303d3d166c761d112ccd8bf274504980e 100644 (file)
@@ -1906,6 +1906,8 @@ static int qeth_l3_get_cast_type(struct sk_buff *skb)
        /* no neighbour (eg AF_PACKET), fall back to target's IP address ... */
        switch (qeth_get_ip_version(skb)) {
        case 4:
+               if (ipv4_is_lbcast(ip_hdr(skb)->daddr))
+                       return RTN_BROADCAST;
                return ipv4_is_multicast(ip_hdr(skb)->daddr) ?
                                RTN_MULTICAST : RTN_UNICAST;
        case 6: