Support IP address protocol

Bug #2039280 reported by Paolo Pisati
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
iproute2 (Ubuntu)
Status tracked in Mantic
Mantic
Confirmed
Undecided
Unassigned

Bug Description

[Impact]

IPv4 and IPv6 addresses can be assigned a protocol value that indicates the
provenance of the IP address. The attribute is modeled after ip route
protocols, and essentially allows the administrator or userspace stack to
tag addresses in some way that makes sense to the actor in question.
Support for this feature was merged with commit 47f0bd503210 ("net: Add new
protocol attribute to IP addresses"), for kernel 5.18.

In this patch, add support for setting the protocol attribute at IP address
addition, replacement, and listing requests.

[Fix]

Apply the attached patch

[How to test]

$ cat << EOF > test.sh
#!/bin/sh

addr=192.0.2.1/28
addr2=${addr%/*}2/${addr#*/}
ifr=test-dummy123

sudo ip link add name "$ifr" type dummy
sudo ip link set "$ifr" up

sudo ip address add dev "$ifr" "$addr2" proto 0x99

sudo ip link del "$ifr"
EOF

$chmod +x test.sh
$test.sh
$ echo $?
0

if you get an error instead, like:
Error: either "local" is duplicate, or "proto" is a garbage.

your iproute2 is not patched.
Alternativerly, you could download Linux v6.5 source code and run:

$ cd linux
$ sudo ./tools/testing/selftests/net/rtnetlink.sh -t kci_test_address_proto

[Regression potential]

Two clean upstream cherry-picks, regression potential should be low.

Tags: patch
Paolo Pisati (p-pisati)
description: updated
description: updated
Revision history for this message
Paolo Pisati (p-pisati) wrote :
description: updated
description: updated
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iproute2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you! I confirmed that the added distro-patches match the upstream patches. The feature looks useful, but it's not very common to backport new features as part of an SRU... So I'll leave that decision to the SRU team.

In either way, this should probably first be fixed in the current "devel" series, i.e. by merging iproute2 v6.4+ from Debian unstable. Once that is accomplished, we can consider this patch for SRU. Would you be interested in working on that merge?

Nitpick: When aiming for SRU, you should consider updating the SRU template in the bug description to the latest version (although, the one you used might also be accepted as-is) and also change the version number according to https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging, e.g.: 6.1.0-1ubuntu2.1

https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.