Commit db8dac20 authored by David S. Miller's avatar David S. Miller
Browse files

[UDP]: Revert udplite and code split.



This reverts commit db1ed684 ("[IPV6]
UDP: Rename IPv6 UDP files."), commit
8be8af8f ("[IPV4] UDP: Move
IPv4-specific bits to other file.") and commit
e898d4db ("[UDP]: Allow users to
configure UDP-Lite.").

First, udplite is of such small cost, and it is a core protocol just
like TCP and normal UDP are.

We spent enormous amounts of effort to make udplite share as much code
with core UDP as possible.  All of that work is less valuable if we're
just going to slap a config option on udplite support.

It is also causing build failures, as reported on linux-next, showing
that the changeset was not tested very well.  In fact, this is the
second build failure resulting from the udplite change.

Finally, the config options provided was a bool, instead of a modular
option.  Meaning the udplite code does not even get build tested
by allmodconfig builds, and furthermore the user is not presented
with a reasonable modular build option which is particularly needed
by distribution vendors.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ba0fa459
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -70,10 +70,8 @@ struct udp_sock {
#define UDPLITE_BIT      0x1  		/* set by udplite proto init function */
#define UDPLITE_SEND_CC  0x2  		/* set via udplite setsockopt         */
#define UDPLITE_RECV_CC  0x4		/* set via udplite setsocktopt        */
#ifdef CONFIG_IP_UDPLITE
	__u8		 pcflag;        /* marks socket as UDP-Lite if > 0    */
	__u8		 unused[3];
#endif
	/*
	 * For encapsulation sockets.
	 */
@@ -85,15 +83,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
	return (struct udp_sock *)sk;
}

#ifdef CONFIG_IP_UDPLITE
#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
#define IS_PROTO_UDPLITE(__proto) ((__proto) == IPPROTO_UDPLITE)
#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP || (level) == SOL_UDPLITE)
#else
#define IS_UDPLITE(__sk) 0
#define IS_PROTO_UDPLITE(__proto) 0
#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP)
#endif

#endif

+0 −5
Original line number Diff line number Diff line
@@ -599,13 +599,8 @@ extern int tcp6_proc_init(void);
extern void tcp6_proc_exit(void);
extern int  udp6_proc_init(void);
extern void udp6_proc_exit(void);
#ifdef CONFIG_IP_UDPLITE
extern int  udplite6_proc_init(void);
extern void udplite6_proc_exit(void);
#else
static inline int udplite6_proc_init(void) { return 0; }
static inline void udplite6_proc_exit(void) { }
#endif
extern int  ipv6_misc_proc_init(void);
extern void ipv6_misc_proc_exit(void);
extern int snmp6_register_dev(struct inet6_dev *idev);
+0 −5
Original line number Diff line number Diff line
@@ -27,13 +27,8 @@ extern int rawv6_init(void);
extern void				rawv6_exit(void);
extern int				udpv6_init(void);
extern void				udpv6_exit(void);
#ifdef CONFIG_IP_UDPLITE
extern int 				udplitev6_init(void);
extern void 				udplitev6_exit(void);
#else
static inline int udplitev6_init(void) { return 0; }
static inline void udplitev6_exit(void) { }
#endif
extern int				tcpv6_init(void);
extern void				tcpv6_exit(void);

+2 −7
Original line number Diff line number Diff line
@@ -25,9 +25,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
/* Designate sk as UDP-Lite socket */
static inline int udplite_sk_init(struct sock *sk)
{
#ifdef CONFIG_IP_UDPLITE
	udp_sk(sk)->pcflag = UDPLITE_BIT;
#endif
	return 0;
}

@@ -71,7 +69,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
{
	int cscov = up->len;
#ifdef CONFIG_IP_UDPLITE

	/*
	 * Sender has set `partial coverage' option on UDP-Lite socket
	 */
@@ -95,15 +93,13 @@ static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
	 *       illegal, we fall back to the defaults here.
	 */
	}
#endif
	return cscov;
}

static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
{
	__wsum csum = 0;
#ifdef CONFIG_IP_UDPLITE
	int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
	__wsum csum = 0;

	skb->ip_summed = CHECKSUM_NONE;     /* no HW support for checksumming */

@@ -116,7 +112,6 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
		if ((cscov -= len) <= 0)
			break;
	}
#endif
	return csum;
}

+0 −10
Original line number Diff line number Diff line
@@ -632,15 +632,5 @@ config TCP_MD5SIG

	  If unsure, say N.

config IP_UDPLITE
	bool "IP: UDP-Lite Protocol (RFC 3828)"
	default n
	---help---
	  UDP-Lite (RFC 3828) is a UDP-like protocol with variable-length
	  checksum.  Read <file:Documentation/networking/udplite.txt> for
	  details.

	  If unsure, say N.

source "net/ipv4/ipvs/Kconfig"
Loading