udp.c (0eea505058740aa45486145296ef4fefbd8cab85) | udp.c (45f6fad84cc305103b28d73482b344d7f5b76f39) |
---|---|
1/* 2 * UDP over IPv6 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on linux/ipv4/udp.c --- 1096 unchanged lines hidden (view full) --- 1105{ 1106 struct ipv6_txoptions opt_space; 1107 struct udp_sock *up = udp_sk(sk); 1108 struct inet_sock *inet = inet_sk(sk); 1109 struct ipv6_pinfo *np = inet6_sk(sk); 1110 DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name); 1111 struct in6_addr *daddr, *final_p, final; 1112 struct ipv6_txoptions *opt = NULL; | 1/* 2 * UDP over IPv6 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on linux/ipv4/udp.c --- 1096 unchanged lines hidden (view full) --- 1105{ 1106 struct ipv6_txoptions opt_space; 1107 struct udp_sock *up = udp_sk(sk); 1108 struct inet_sock *inet = inet_sk(sk); 1109 struct ipv6_pinfo *np = inet6_sk(sk); 1110 DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name); 1111 struct in6_addr *daddr, *final_p, final; 1112 struct ipv6_txoptions *opt = NULL; |
1113 struct ipv6_txoptions *opt_to_free = NULL; |
|
1113 struct ip6_flowlabel *flowlabel = NULL; 1114 struct flowi6 fl6; 1115 struct dst_entry *dst; 1116 int addr_len = msg->msg_namelen; 1117 int ulen = len; 1118 int hlimit = -1; 1119 int tclass = -1; 1120 int dontfrag = -1; --- 137 unchanged lines hidden (view full) --- 1258 flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); 1259 if (!flowlabel) 1260 return -EINVAL; 1261 } 1262 if (!(opt->opt_nflen|opt->opt_flen)) 1263 opt = NULL; 1264 connected = 0; 1265 } | 1114 struct ip6_flowlabel *flowlabel = NULL; 1115 struct flowi6 fl6; 1116 struct dst_entry *dst; 1117 int addr_len = msg->msg_namelen; 1118 int ulen = len; 1119 int hlimit = -1; 1120 int tclass = -1; 1121 int dontfrag = -1; --- 137 unchanged lines hidden (view full) --- 1259 flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); 1260 if (!flowlabel) 1261 return -EINVAL; 1262 } 1263 if (!(opt->opt_nflen|opt->opt_flen)) 1264 opt = NULL; 1265 connected = 0; 1266 } |
1266 if (!opt) 1267 opt = np->opt; | 1267 if (!opt) { 1268 opt = txopt_get(np); 1269 opt_to_free = opt; 1270 } |
1268 if (flowlabel) 1269 opt = fl6_merge_options(&opt_space, flowlabel, opt); 1270 opt = ipv6_fixup_options(&opt_space, opt); 1271 1272 fl6.flowi6_proto = sk->sk_protocol; 1273 if (!ipv6_addr_any(daddr)) 1274 fl6.daddr = *daddr; 1275 else --- 92 unchanged lines hidden (view full) --- 1368 dst_release(dst); 1369 } 1370 dst = NULL; 1371 } 1372 1373out: 1374 dst_release(dst); 1375 fl6_sock_release(flowlabel); | 1271 if (flowlabel) 1272 opt = fl6_merge_options(&opt_space, flowlabel, opt); 1273 opt = ipv6_fixup_options(&opt_space, opt); 1274 1275 fl6.flowi6_proto = sk->sk_protocol; 1276 if (!ipv6_addr_any(daddr)) 1277 fl6.daddr = *daddr; 1278 else --- 92 unchanged lines hidden (view full) --- 1371 dst_release(dst); 1372 } 1373 dst = NULL; 1374 } 1375 1376out: 1377 dst_release(dst); 1378 fl6_sock_release(flowlabel); |
1379 txopt_put(opt_to_free); |
|
1376 if (!err) 1377 return len; 1378 /* 1379 * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting 1380 * ENOBUFS might not be good (it's not tunable per se), but otherwise 1381 * we don't have a good statistic (IpOutDiscards but it can be too many 1382 * things). We could add another new stat but at least for now that 1383 * seems like overkill. --- 200 unchanged lines hidden --- | 1380 if (!err) 1381 return len; 1382 /* 1383 * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting 1384 * ENOBUFS might not be good (it's not tunable per se), but otherwise 1385 * we don't have a good statistic (IpOutDiscards but it can be too many 1386 * things). We could add another new stat but at least for now that 1387 * seems like overkill. --- 200 unchanged lines hidden --- |