Skip to contentSkip to conversation

question about __udp6_lib_err usage of __udp6_lib_lookup

DISCUSSION Dave Jones 2 participants 2 messages Sep 5, 2013

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

__udp6_lib_lookup's prototype is ...

struct sock *__udp6_lib_lookup(struct net *net,
const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, __be16 dport, int dif, struct udp_table *udptable)

But the usage in __udp6_lib_err is...

521 sk = __udp6_lib_lookup(dev_net(skb->dev), daddr, uh->dest,
522 saddr, uh->source, inet6_iif(skb), udptable);

With the source/dest addr/port arguments swapped. Is this intentional ?

Dave

maintainer
#1 lore raw

From: Dave Jones <[email protected]>
Date: Wed, 4 Sep 2013 22:44:34 -0400

Quoted 7 lines

__udp6_lib_lookup's prototype is ...

struct sock *__udp6_lib_lookup(struct net *net,
const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, __be16 dport, int dif, struct udp_table *udptable)

Quoted 6 lines

But the usage in __udp6_lib_err is...

521 sk = __udp6_lib_lookup(dev_net(skb->dev), daddr, uh->dest,
522 saddr, uh->source, inet6_iif(skb), udptable);

With the source/dest addr/port arguments swapped. Is this intentional ?

Yes, because we are looking at the headers of a packet we transmitted, quoted in an ICMP response.