*/
static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
struct udphdr *uh,
- __be32 saddr, __be32 daddr,
- int proto)
+ __be32 saddr, __be32 daddr)
{
struct udp_table *udptable = net->ipv4.udp_table;
unsigned int hash2, hash2_any, offset;
* All we need to do is get the socket, and then do a checksum.
*/
-static int __udp4_lib_rcv(struct sk_buff *skb, int proto)
+int udp_rcv(struct sk_buff *skb)
{
struct rtable *rt = skb_rtable(skb);
struct net *net = dev_net(skb->dev);
}
if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
- return __udp4_lib_mcast_deliver(net, skb, uh, saddr, daddr, proto);
+ return __udp4_lib_mcast_deliver(net, skb, uh, saddr, daddr);
sk = __udp4_lib_lookup_skb(skb, uh->source, uh->dest);
if (sk)
short_packet:
drop_reason = SKB_DROP_REASON_PKT_TOO_SMALL;
- net_dbg_ratelimited("UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n",
- proto == IPPROTO_UDPLITE ? "Lite" : "",
+ net_dbg_ratelimited("UDP: short packet: From %pI4:%u %d/%d to %pI4:%u\n",
&saddr, ntohs(uh->source),
ulen, skb->len,
&daddr, ntohs(uh->dest));
* the network is concerned, anyway) as per 4.1.3.4 (MUST).
*/
drop_reason = SKB_DROP_REASON_UDP_CSUM;
- net_dbg_ratelimited("UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n",
- proto == IPPROTO_UDPLITE ? "Lite" : "",
+ net_dbg_ratelimited("UDP: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n",
&saddr, ntohs(uh->source), &daddr, ntohs(uh->dest),
ulen);
__UDP_INC_STATS(net, UDP_MIB_CSUMERRORS);
return SKB_NOT_DROPPED_YET;
}
-int udp_rcv(struct sk_buff *skb)
-{
- return __udp4_lib_rcv(skb, IPPROTO_UDP);
-}
-
static void udp_destroy_sock(struct sock *sk)
{
struct udp_sock *up = udp_sk(sk);
*/
static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
const struct in6_addr *saddr,
- const struct in6_addr *daddr,
- int proto)
+ const struct in6_addr *daddr)
{
struct udp_table *udptable = net->ipv4.udp_table;
const struct udphdr *uh = udp_hdr(skb);
return 0;
}
-static int __udp6_lib_rcv(struct sk_buff *skb, int proto)
+INDIRECT_CALLABLE_SCOPE int udpv6_rcv(struct sk_buff *skb)
{
enum skb_drop_reason reason = SKB_DROP_REASON_NOT_SPECIFIED;
const struct in6_addr *saddr, *daddr;
* Multicast receive code
*/
if (ipv6_addr_is_multicast(daddr))
- return __udp6_lib_mcast_deliver(net, skb, saddr, daddr, proto);
+ return __udp6_lib_mcast_deliver(net, skb, saddr, daddr);
/* Unicast */
sk = __udp6_lib_lookup_skb(skb, uh->source, uh->dest);
short_packet:
if (reason == SKB_DROP_REASON_NOT_SPECIFIED)
reason = SKB_DROP_REASON_PKT_TOO_SMALL;
- net_dbg_ratelimited("UDP%sv6: short packet: From [%pI6c]:%u %d/%d to [%pI6c]:%u\n",
- proto == IPPROTO_UDPLITE ? "-Lite" : "",
+ net_dbg_ratelimited("UDPv6: short packet: From [%pI6c]:%u %d/%d to [%pI6c]:%u\n",
saddr, ntohs(uh->source),
ulen, skb->len,
daddr, ntohs(uh->dest));
}
}
-INDIRECT_CALLABLE_SCOPE int udpv6_rcv(struct sk_buff *skb)
-{
- return __udp6_lib_rcv(skb, IPPROTO_UDP);
-}
-
/*
* Throw away all pending data and cancel the corking. Socket is locked.
*/