summaryrefslogtreecommitdiff
path: root/net/netfilter/xt_TCPMSS.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 02:16:48 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 15:08:51 -0800
commita1bbb0e698b4ba18c6356564923bb395bed0e576 (patch)
tree65db5ef33bd9aa37c9a6a562c4f6bf08f702d71c /net/netfilter/xt_TCPMSS.c
parent5a49d0e04d62ab3f85aea4d15e0ca8be9b0ee89b (diff)
netfilter: Use flowi4 and flowi6 in xt_TCPMSS
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/xt_TCPMSS.c')
-rw-r--r--net/netfilter/xt_TCPMSS.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index eb81c380da1b..6e6b46cb1db9 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -148,16 +148,21 @@ tcpmss_mangle_packet(struct sk_buff *skb,
static u_int32_t tcpmss_reverse_mtu(const struct sk_buff *skb,
unsigned int family)
{
- struct flowi fl = {};
+ struct flowi fl;
const struct nf_afinfo *ai;
struct rtable *rt = NULL;
u_int32_t mtu = ~0U;
- if (family == PF_INET)
- fl.fl4_dst = ip_hdr(skb)->saddr;
- else
- fl.fl6_dst = ipv6_hdr(skb)->saddr;
+ if (family == PF_INET) {
+ struct flowi4 *fl4 = &fl.u.ip4;
+ memset(fl4, 0, sizeof(*fl4));
+ fl4->daddr = ip_hdr(skb)->saddr;
+ } else {
+ struct flowi6 *fl6 = &fl.u.ip6;
+ memset(fl6, 0, sizeof(*fl6));
+ ipv6_addr_copy(&fl6->daddr, &ipv6_hdr(skb)->saddr);
+ }
rcu_read_lock();
ai = nf_get_afinfo(family);
if (ai != NULL)