Project

General

Profile

Actions

Bug #3347

closed

zonecfg(1M) is confused about selection

Added by Rich Lowe over 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zones
Start date:
2012-11-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

net:
    address: 172.16.0.1/24
    allowed-address not specified
    physical: afe0
    defrouter not specified
net:
    address: 172.16.1.1/24
    allowed-address not specified
    physical: puppet0
    defrouter not specified
zonecfg:puppet> select net address=172.16.1.1
select net: Insufficient specification
zonecfg:puppet> select net address=172.16.1.1/24
select net: Insufficient specification

I don't see why they're insufficient?

Also, on another host I was recently screwed by doing:

select net address=172.16.1.1
set address=172.16.1.2

and finding that both of my 'net' entries had been clobbered (this was on a host whereby both interfaces were on ipmp0, one ipv6, one ipv4). I'm not sure whether that's related.

Actions #1

Updated by Gary Mills almost 9 years ago

  • Status changed from New to Feedback
  • Assignee set to Gary Mills

I'll see what I can do with this one.

Actions #2

Updated by Gary Mills almost 9 years ago

The problem is that the select subcommand overwrites the in-memory data, and that the subsequent end subcommand writes it out to the underlying file. Here's an example:


'#' zonecfg -z tzone
zonecfg:tzone> info net
net:
address: 172.16.0.1/24
allowed-address not specified
physical: e1000g0
defrouter not specified
net:
address: 172.16.1.1/24
allowed-address not specified
physical: e1000g0
defrouter not specified
zonecfg:tzone> select net address=172.16.1.1
zonecfg:tzone:net> end
zonecfg:tzone> info net
net:
address: 172.16.1.1/24
allowed-address not specified
physical: e1000g0
defrouter not specified
net:
address: 172.16.1.1/24
allowed-address not specified
physical: e1000g0
defrouter not specified
zonecfg:tzone> exit

Actions #3

Updated by Gary Mills almost 9 years ago

  • % Done changed from 0 to 100

This error only occurs when the physical devices are the same in both network nodes. The culprit was this line in the zonecfg_delete_nwif_core() library function:


if ((addr_match || allowed_addr_match) && phys_match) {

Actions #4

Updated by Electric Monk almost 9 years ago

  • Status changed from Feedback to Closed

git commit 5e74f94d8c2a16c2ef7cf2940a157ffabb379c27

commit  5e74f94d8c2a16c2ef7cf2940a157ffabb379c27
Author: Gary Mills <gary_mills@fastmail.fm>
Date:   2014-07-14T15:36:04.000Z

    3347 zonecfg(1M) is confused about selection
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Actions

Also available in: Atom PDF