Bug 217452 - net/dhcp6 command_flags does not need to be referenced inside of the command_args
Summary: net/dhcp6 command_flags does not need to be referenced inside of the command_...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 15:09 UTC by Andrey Pevnev
Modified: 2018-09-02 21:02 UTC (History)
2 users (show)

See Also:
pi: maintainer-feedback-


Attachments
patch (472 bytes, patch)
2018-06-28 21:14 UTC, Craig Leres
leres: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Pevnev 2017-03-01 15:09:45 UTC
Default port startup script results in the following command line (dhcp6c_flags is set to "-n" in /etc/rc.local):

/usr/local/sbin/dhcp6c -n -c /usr/local/etc/dhcp6c.conf -p /var/run/dhcp6c.pid -n bge1

I suggest the following patch which removes duplicate -n argument just before the interface name:

Index: dhcp6c.in
===================================================================
--- dhcp6c.in	(revision 435147)
+++ dhcp6c.in	(working copy)
@@ -39,7 +39,7 @@
 
 required_files="${dhcp6c_config}"
 pidfile="${dhcp6c_pidfile}"
-command_args="-c ${dhcp6c_config} -p ${dhcp6c_pidfile} ${dhcp6c_flags} ${dhcp6c_interfaces}"
+command_args="-c ${dhcp6c_config} -p ${dhcp6c_pidfile} ${dhcp6c_interfaces}"
 
 dhcp6c_precmd()
 {
Comment 1 Craig Leres freebsd_committer 2018-06-28 21:14:36 UTC
Created attachment 194713 [details]
patch

I noticed this today while working on a different dhcp6 problem. If you add:

    dhcp6c_flags="-d"

to /etc/rc.conf you'll see that -d is applied twice:

    ice 17 # ps wwu60049
    USER   PID %CPU %MEM  VSZ  RSS TT  STAT STARTED    TIME COMMAND
    root 60049  0.0  0.0 8488 2492  -  Ss   13:53   0:00.00 /usr/local/sbin/dhcp6c -d -c /usr/local/etc/dhcp6c.conf -p /var/run/dhcp6c.pid -d igb1

Here's the patch as an attachment; I'm happy to commit with maintainer approval.
Comment 2 Kurt Jaeger freebsd_committer 2018-09-02 21:01:41 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer 2018-09-02 21:02:44 UTC
A commit references this bug:

Author: pi
Date: Sun Sep  2 21:02:12 UTC 2018
New revision: 478819
URL: https://svnweb.freebsd.org/changeset/ports/478819

Log:
  net/dhcp6: several fixes

  - rcorder incorrect (Circular dependency on provision `DAEMON')
  - command_flags do not need to be referenced inside of the command_args
  - dhcp6s exits because of shutdown on non-connected UDP socket

  PR:		216673, 217452, 228994
  Submitted by:	tdb, Andrey Pevnev <apevnev@me.com>, leres, Dries Michiels <driesm.michiels@gmail.com>
  Approved by:	hrs (maintainer timeout)
  Differential Revision:	D16994

Changes:
  head/net/dhcp6/Makefile
  head/net/dhcp6/files/dhcp6c.in
  head/net/dhcp6/files/dhcp6s.in
  head/net/dhcp6/files/patch-dhcp6s.c