diff mbox

iproute2 small patches for xfrm

Message ID 2141002.LfKmUBSlWz@ul001176
State Changes Requested, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Jaroslav Šafka Aug. 1, 2014, 11:16 a.m. UTC
Hi,
I found the tool "ip xfrm" is not able to add "cipher_null" because there is 
no possibility to set key with zero length.

I solved it by this change:

-       if (slen > 2 && strncmp(key, "0x", 2) == 0) {
+       if (slen >= 2 && strncmp(key, "0x", 2) == 0) {

By this change you can specify key as "0x" which will pass for key existence 
and set key len to 0.

this patch is against version iproute2-3.14.0

Second patch enable use proto ip. Because it is supported by kernel.

Have a nice day :)

Regards
Jarek

Comments

Stephen Hemminger Aug. 1, 2014, 4:05 p.m. UTC | #1
On Fri, 01 Aug 2014 13:16:09 +0200
Jaroslav Šafka <jaroslav.safka@tieto.com> wrote:

> Hi,
> I found the tool "ip xfrm" is not able to add "cipher_null" because there is 
> no possibility to set key with zero length.
> 
> I solved it by this change:
> 
> -       if (slen > 2 && strncmp(key, "0x", 2) == 0) {
> +       if (slen >= 2 && strncmp(key, "0x", 2) == 0) {
> 
> By this change you can specify key as "0x" which will pass for key existence 
> and set key len to 0.
> 
> this patch is against version iproute2-3.14.0
> 
> Second patch enable use proto ip. Because it is supported by kernel.
> 
> Have a nice day :)
> 
> Regards
> Jarek

Please format patches in same manner as kernel patches as described
in Documentation/SubmittingPatches.  One patch per email; email with [PATCH]
in subject line; and please don't use attachments if possible.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index cce5151..05e4098 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -1280,6 +1281,7 @@  static int xfrm_selector_upspec_parse(struct xfrm_selector *sel,
 		missarg("UPSPEC");
 	if (sportp || dportp) {
 		switch (sel->proto) {
+		case IPPROTO_IP:
 		case IPPROTO_TCP:
 		case IPPROTO_UDP:
 		case IPPROTO_SCTP: