Skip to contentSkip to conversation

neighbour : fix ndm_type type error issue

PATCH In review Jun Zhao 4 participants 7 messages Jul 25, 2014 – Jul 29, 2014

Subsystems (2)
lore
Share & tools
lore

Jun Zhao

author
#0 lore raw

PATCH 1/1 neighbour : fix ndm_type type error issue

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST. NDA_DST is for netlink TLV type, hence it's not right value in this context.

---
 drivers/net/vxlan.c  |    2 +-
 net/core/neighbour.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/vxlan.c +1 -1
index d3f3e5d..1fb7b37 100644
@@ -340,7 +340,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
 	ndm->ndm_state = fdb->state;
 	ndm->ndm_ifindex = vxlan->dev->ifindex;
 	ndm->ndm_flags = fdb->flags;
-	ndm->ndm_type = NDA_DST;
+	ndm->ndm_type = RTN_UNICAST;
 
 	if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr))
 		goto nla_put_failure;
net/core/neighbour.c +1 -1
index 559890b..ef31fef 100644
@@ -2249,7 +2249,7 @@ static int pneigh_fill_info(struct sk_buff *skb, struct pneigh_entry *pn,
 	ndm->ndm_pad1    = 0;
 	ndm->ndm_pad2    = 0;
 	ndm->ndm_flags	 = pn->flags | NTF_PROXY;
-	ndm->ndm_type	 = NDA_DST;
+	ndm->ndm_type	 = RTN_UNICAST;
 	ndm->ndm_ifindex = pn->dev->ifindex;
 	ndm->ndm_state	 = NUD_NONE;
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Jun Zhao

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST. NDA_DST is for netlink TLV type, hence it's not right value in this context.

Looks correct to me, at least libnl uses RTN_* for ndm_type.

Acked-by on v1 1/1
#2 lore raw
In reply to Jun Zhao
Quoted 4 lines · Jun Zhao

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST.
NDA_DST is for netlink TLV type, hence it's not right value in this context.

The value of NDA_DST == RTN_UNICAST, otherwise we couldn't do this change as it would alter e.g. arpd behavior.

Thanks,
Hannes

author
#3 lore raw
Quoted 6 lines · Hannes Frederic Sowa
Quoted 4 lines · Jun Zhao

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST.
NDA_DST is for netlink TLV type, hence it's not right value in this context.

Quoted 7 lines

The value of NDA_DST == RTN_UNICAST, otherwise we couldn't do this change as it would alter e.g. arpd behavior.

Thanks,
Hannes

But I think NDA_DST/RTN_UNICAST have different means in this context, even though the value of NDA_DST == RTN_UNICAST.

For arp proxy/NDP proxy context, ndm_type means the peer L3 address, so RTN_UNICAST is the right value. For vxlan have similar semantic for remote ip.

BTW: In the source code, implicit think NDA_DST == RTN_UNICAST maybe not a good idea when we don't have a comment or the other explain.

#4 lore raw

Hi,

Quoted 18 lines · Jun Zhao
Quoted 6 lines · Hannes Frederic Sowa
Quoted 4 lines · Jun Zhao

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST.
NDA_DST is for netlink TLV type, hence it's not right value in this context.

Quoted 7 lines

The value of NDA_DST == RTN_UNICAST, otherwise we couldn't do this change as it would alter e.g. arpd behavior.

Thanks,
Hannes

But I think NDA_DST/RTN_UNICAST have different means in this context, even though the value of NDA_DST == RTN_UNICAST.

Quoted 6 lines

For arp proxy/NDP proxy context, ndm_type means the peer L3 address, so RTN_UNICAST is the right value. For vxlan have similar semantic for remote ip.

BTW: In the source code, implicit think NDA_DST == RTN_UNICAST maybe not a good idea when we don't have a comment or the other explain.

I am totally with you and think your change is good, that's why I also gave my ack to your patch.

My comment above was about my concerns regarding making a user space visible change, which in the end could alter the behavior of already existing software.

Developers maybe have debugged code and seen some different value being propagated from the kernel and this software could now break if we would change the value after all those years.

Bye,
Hannes

author
#5 lore raw

Hi, Hannes

Quoted 35 lines · Hannes Frederic Sowa

Hi,

Quoted 18 lines · Jun Zhao
Quoted 6 lines · Hannes Frederic Sowa
Quoted 4 lines · Jun Zhao

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST.
NDA_DST is for netlink TLV type, hence it's not right value in this context.

Quoted 7 lines

The value of NDA_DST == RTN_UNICAST, otherwise we couldn't do this change as it would alter e.g. arpd behavior.

Thanks,
Hannes

But I think NDA_DST/RTN_UNICAST have different means in this context, even though the value of NDA_DST == RTN_UNICAST.

Quoted 6 lines

For arp proxy/NDP proxy context, ndm_type means the peer L3 address, so RTN_UNICAST is the right value. For vxlan have similar semantic for remote ip.

BTW: In the source code, implicit think NDA_DST == RTN_UNICAST maybe not a good idea when we don't have a comment or the other explain.

I am totally with you and think your change is good, that's why I also gave my ack to your patch.

My comment above was about my concerns regarding making a user space visible change, which in the end could alter the behavior of already existing software.

Quoted 6 lines

Developers maybe have debugged code and seen some different value being propagated from the kernel and this software could now break if we would change the value after all those years.

Bye,
Hannes

Lucky, NDA_DST == RTN_UNICAST is true really in source code :)

/* rtm_type */

enum {
RTN_UNSPEC,
RTN_UNICAST,
...
}

enum {
NDA_UNSPEC,
NDA_DST,
...
}