From: Harvey Yang <hidden> Date: 2013-01-15 04:43:11
The destination address daddr is faddr if source route option is set, otherwise it is inet_daddr. So use if-else to assign the value.
Signed-off-by: Harvey Yang <redacted>
---
net/ipv4/ip_output.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -349,10 +349,10 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)__be32daddr;/* Use correct destination address if we have options. */-daddr=inet->inet_daddr;if(inet_opt&&inet_opt->opt.srr)daddr=inet_opt->opt.faddr;-+else+daddr=inet->inet_daddr;/* If this fails, retransmit mechanism of transport layer will*keeptryinguntilrouteappearsortheconnectiontimes*itselfout.
From: David Miller <davem@davemloft.net> Date: 2013-01-15 04:48:12
From: Harvey Yang <redacted>
Date: Tue, 15 Jan 2013 12:47:35 +0800
The destination address daddr is faddr if source route option is set, otherwise it is inet_daddr. So use if-else to assign the value.
Signed-off-by: Harvey Yang <redacted>
You are changing nothing in how this code behaves. And stylistically
I know it was coded this way on purpose, because I'm pretty sure I
wrote it.
From: Eric Dumazet <hidden> Date: 2013-01-15 04:57:14
On Tue, 2013-01-15 at 12:47 +0800, Harvey Yang wrote:
quoted hunk
The destination address daddr is faddr if source route option is set, otherwise it is inet_daddr. So use if-else to assign the value.
Signed-off-by: Harvey Yang <redacted>
---
net/ipv4/ip_output.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -349,10 +349,10 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)__be32daddr;/* Use correct destination address if we have options. */-daddr=inet->inet_daddr;if(inet_opt&&inet_opt->opt.srr)daddr=inet_opt->opt.faddr;-+else+daddr=inet->inet_daddr;/* If this fails, retransmit mechanism of transport layer will*keeptryinguntilrouteappearsortheconnectiontimes*itselfout.
On Mon, Jan 14, 2013 at 08:57:09PM -0800, Eric Dumazet wrote:
On Tue, 2013-01-15 at 12:47 +0800, Harvey Yang wrote:
quoted
The destination address daddr is faddr if source route option is set, otherwise it is inet_daddr. So use if-else to assign the value.
Signed-off-by: Harvey Yang <redacted>
---
net/ipv4/ip_output.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -349,10 +349,10 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)__be32daddr;/* Use correct destination address if we have options. */-daddr=inet->inet_daddr;if(inet_opt&&inet_opt->opt.srr)daddr=inet_opt->opt.faddr;-+else+daddr=inet->inet_daddr;/* If this fails, retransmit mechanism of transport layer will*keeptryinguntilrouteappearsortheconnectiontimes*itselfout.
Current code is faster, srr is not often used.
If you turn on O2 option in GCC, both versions behave the same (generate same
binary code). If srr is not often used, why not use unlikely() macro?
- cong