@@ -99,8 +99,9 @@ func contains(addrs []netlink.Addr, addr *net.IPNet) bool {
99
99
}
100
100
101
101
const (
102
- VethName = "ethwe" // name inside container namespace
103
- vethPrefix = "v" + VethName // starts with "veth" to suppress UI notifications
102
+ VethName = "ethwe" // name inside container namespace
103
+ //vethPrefix = "v" + VethName // starts with "veth" to suppress UI notifications
104
+ vethPrefix = "v"
104
105
)
105
106
106
107
func interfaceExistsInNamespace (netNSPath string , ifName string ) bool {
@@ -119,11 +120,13 @@ func AttachContainer(netNSPath, id, ifName, bridgeName string, mtu int, withMult
119
120
defer ns .Close ()
120
121
121
122
if ! interfaceExistsInNamespace (netNSPath , ifName ) {
122
- maxIDLen := IFNAMSIZ - 1 - len (vethPrefix + "pl" )
123
+ //maxIDLen := IFNAMSIZ - 1 - len(vethPrefix+"pl")
124
+ maxIDLen := IFNAMSIZ - 1 - len (vethPrefix + "l" )
123
125
if len (id ) > maxIDLen {
124
126
id = id [:maxIDLen ] // trim passed ID if too long
125
127
}
126
- name , peerName := vethPrefix + "pl" + id , vethPrefix + "pg" + id
128
+ //name, peerName := vethPrefix+"pl"+id, vethPrefix+"pg"+id
129
+ name , peerName := vethPrefix + "l" + id , vethPrefix + "g" + id
127
130
veth , err := CreateAndAttachVeth (name , peerName , bridgeName , mtu , keepTXOn , true , func (veth netlink.Link ) error {
128
131
if err := netlink .LinkSetNsFd (veth , int (ns )); err != nil {
129
132
return fmt .Errorf ("failed to move veth to container netns: %s" , err )
0 commit comments