aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_frontend.c12
-rw-r--r--net/ipv4/ip_gre.c14
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/ipip.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c2
-rw-r--r--net/ipv4/tcp_input.c2
6 files changed, 23 insertions, 11 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 78b514ba141..60123905dbb 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -128,13 +128,14 @@ struct net_device * ip_dev_find(__be32 addr)
128 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; 128 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } };
129 struct fib_result res; 129 struct fib_result res;
130 struct net_device *dev = NULL; 130 struct net_device *dev = NULL;
131 struct fib_table *local_table;
131 132
132#ifdef CONFIG_IP_MULTIPLE_TABLES 133#ifdef CONFIG_IP_MULTIPLE_TABLES
133 res.r = NULL; 134 res.r = NULL;
134#endif 135#endif
135 136
136 if (!ip_fib_local_table || 137 local_table = fib_get_table(RT_TABLE_LOCAL);
137 ip_fib_local_table->tb_lookup(ip_fib_local_table, &fl, &res)) 138 if (!local_table || local_table->tb_lookup(local_table, &fl, &res))
138 return NULL; 139 return NULL;
139 if (res.type != RTN_LOCAL) 140 if (res.type != RTN_LOCAL)
140 goto out; 141 goto out;
@@ -152,6 +153,7 @@ unsigned inet_addr_type(__be32 addr)
152 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; 153 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } };
153 struct fib_result res; 154 struct fib_result res;
154 unsigned ret = RTN_BROADCAST; 155 unsigned ret = RTN_BROADCAST;
156 struct fib_table *local_table;
155 157
156 if (ZERONET(addr) || BADCLASS(addr)) 158 if (ZERONET(addr) || BADCLASS(addr))
157 return RTN_BROADCAST; 159 return RTN_BROADCAST;
@@ -162,10 +164,10 @@ unsigned inet_addr_type(__be32 addr)
162 res.r = NULL; 164 res.r = NULL;
163#endif 165#endif
164 166
165 if (ip_fib_local_table) { 167 local_table = fib_get_table(RT_TABLE_LOCAL);
168 if (local_table) {
166 ret = RTN_UNICAST; 169 ret = RTN_UNICAST;
167 if (!ip_fib_local_table->tb_lookup(ip_fib_local_table, 170 if (!local_table->tb_lookup(local_table, &fl, &res)) {
168 &fl, &res)) {
169 ret = res.type; 171 ret = res.type;
170 fib_res_put(&res); 172 fib_res_put(&res);
171 } 173 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f151900efaf..02b02a8d681 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -674,7 +674,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
674 struct rtable *rt; /* Route to the other host */ 674 struct rtable *rt; /* Route to the other host */
675 struct net_device *tdev; /* Device to other host */ 675 struct net_device *tdev; /* Device to other host */
676 struct iphdr *iph; /* Our new IP header */ 676 struct iphdr *iph; /* Our new IP header */
677 int max_headroom; /* The extra header space needed */ 677 unsigned int max_headroom; /* The extra header space needed */
678 int gre_hlen; 678 int gre_hlen;
679 __be32 dst; 679 __be32 dst;
680 int mtu; 680 int mtu;
@@ -1033,7 +1033,6 @@ static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
1033 return 0; 1033 return 0;
1034} 1034}
1035 1035
1036#ifdef CONFIG_NET_IPGRE_BROADCAST
1037/* Nice toy. Unfortunately, useless in real life :-) 1036/* Nice toy. Unfortunately, useless in real life :-)
1038 It allows to construct virtual multiprotocol broadcast "LAN" 1037 It allows to construct virtual multiprotocol broadcast "LAN"
1039 over the Internet, provided multicast routing is tuned. 1038 over the Internet, provided multicast routing is tuned.
@@ -1092,10 +1091,19 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
1092 return -t->hlen; 1091 return -t->hlen;
1093} 1092}
1094 1093
1094static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr)
1095{
1096 struct iphdr *iph = (struct iphdr*) skb_mac_header(skb);
1097 memcpy(haddr, &iph->saddr, 4);
1098 return 4;
1099}
1100
1095static const struct header_ops ipgre_header_ops = { 1101static const struct header_ops ipgre_header_ops = {
1096 .create = ipgre_header, 1102 .create = ipgre_header,
1103 .parse = ipgre_header_parse,
1097}; 1104};
1098 1105
1106#ifdef CONFIG_NET_IPGRE_BROADCAST
1099static int ipgre_open(struct net_device *dev) 1107static int ipgre_open(struct net_device *dev)
1100{ 1108{
1101 struct ip_tunnel *t = netdev_priv(dev); 1109 struct ip_tunnel *t = netdev_priv(dev);
@@ -1197,6 +1205,8 @@ static int ipgre_tunnel_init(struct net_device *dev)
1197 dev->stop = ipgre_close; 1205 dev->stop = ipgre_close;
1198 } 1206 }
1199#endif 1207#endif
1208 } else {
1209 dev->header_ops = &ipgre_header_ops;
1200 } 1210 }
1201 1211
1202 if (!tdev && tunnel->parms.link) 1212 if (!tdev && tunnel->parms.link)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index f508835ba71..e5f7dc2de30 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -161,7 +161,7 @@ static inline int ip_finish_output2(struct sk_buff *skb)
161 struct dst_entry *dst = skb->dst; 161 struct dst_entry *dst = skb->dst;
162 struct rtable *rt = (struct rtable *)dst; 162 struct rtable *rt = (struct rtable *)dst;
163 struct net_device *dev = dst->dev; 163 struct net_device *dev = dst->dev;
164 int hh_len = LL_RESERVED_SPACE(dev); 164 unsigned int hh_len = LL_RESERVED_SPACE(dev);
165 165
166 if (rt->rt_type == RTN_MULTICAST) 166 if (rt->rt_type == RTN_MULTICAST)
167 IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); 167 IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 5cd5bbe1379..8c2b2b0741d 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -515,7 +515,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
515 struct net_device *tdev; /* Device to other host */ 515 struct net_device *tdev; /* Device to other host */
516 struct iphdr *old_iph = ip_hdr(skb); 516 struct iphdr *old_iph = ip_hdr(skb);
517 struct iphdr *iph; /* Our new IP header */ 517 struct iphdr *iph; /* Our new IP header */
518 int max_headroom; /* The extra header space needed */ 518 unsigned int max_headroom; /* The extra header space needed */
519 __be32 dst = tiph->daddr; 519 __be32 dst = tiph->daddr;
520 int mtu; 520 int mtu;
521 521
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index d0a92dec105..7c074e386c1 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -325,7 +325,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
325 __be16 df = old_iph->frag_off; 325 __be16 df = old_iph->frag_off;
326 sk_buff_data_t old_transport_header = skb->transport_header; 326 sk_buff_data_t old_transport_header = skb->transport_header;
327 struct iphdr *iph; /* Our new IP header */ 327 struct iphdr *iph; /* Our new IP header */
328 int max_headroom; /* The extra header space needed */ 328 unsigned int max_headroom; /* The extra header space needed */
329 int mtu; 329 int mtu;
330 330
331 EnterFunction(10); 331 EnterFunction(10);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9288220b73a..3dbbb44b3e7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3909,7 +3909,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3909 3909
3910 while (before(start, end)) { 3910 while (before(start, end)) {
3911 struct sk_buff *nskb; 3911 struct sk_buff *nskb;
3912 int header = skb_headroom(skb); 3912 unsigned int header = skb_headroom(skb);
3913 int copy = SKB_MAX_ORDER(header, 0); 3913 int copy = SKB_MAX_ORDER(header, 0);
3914 3914
3915 /* Too big header? This can happen with IPv6. */ 3915 /* Too big header? This can happen with IPv6. */