Commit Graph

86 Commits

Author SHA1 Message Date
chao an
e031a82882 netutils/dhcp: fix build warning/break of dhcp6c
dhcp6c.c:222:3: error: unknown type name ‘pthread_t’
  222 |   pthread_t thread;
      |   ^~~~~~~~~
dhcp6c.c: In function ‘dhcp6c_get_result’:
dhcp6c.c:415:7: warning: implicit declaration of function ‘netlib_prefix2ipv6netmask’ [-Wimplicit-function-declaration]
  415 |       netlib_prefix2ipv6netmask(presult->pl, &presult->netmask);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
dhcp6c.c: In function ‘dhcp6c_parse_ia’:
dhcp6c.c:1046:30: warning: unused variable ‘pdhcp6c’ [-Wunused-variable]
 1046 |   FAR struct dhcp6c_state_s *pdhcp6c = (FAR struct dhcp6c_state_s *)handle;
      |                              ^~~~~~~
dhcp6c.c: In function ‘dhcp6c_precise_open’:
dhcp6c.c:1702:3: warning: missing braces around initializer [-Wmissing-braces]
 1702 |   {
      |   ^
......
 1706 |     {0},
      |      -
      |      {{0}}
dhcp6c.c:1796:43: error: ‘UDP_BINDTODEVICE’ undeclared (first use in this function); did you mean ‘SO_BINDTODEVICE’?
 1796 |   setsockopt(pdhcp6c->sockfd, SOL_SOCKET, UDP_BINDTODEVICE, ifname,
      |                                           ^~~~~~~~~~~~~~~~
      |                                           SO_BINDTODEVICE
dhcp6c.c:1796:43: note: each undeclared identifier is reported only once for each function it appears in
dhcp6c.c: In function ‘dhcp6c_request_async’:
dhcp6c.c:1886:9: warning: implicit declaration of function ‘pthread_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
 1886 |   ret = pthread_create(&pdhcp6c->thread, NULL, dhcp6c_run, pdhcp6c);
      |         ^~~~~~~~~~~~~~
      |         timer_create

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-06 19:31:16 +08:00
chao.an
995aef9d99 net/sockopt: move BINDTODEVICE to socket level
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 00:11:23 +08:00
liuhaitao
06754940c5 dhcpd: fix build warning
CC:  dhcpd.c
In function 'dhcpd_openlistener',
    inlined from 'dhcpd_run.part.0' at dhcpd.c:1513:20:
dhcpd.c:1425:3: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]
 1425 |   strncpy(req.ifr_name, interface, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-08-14 14:08:52 +03:00
chao.an
496aa3ef4f netutils/dhcpd: bind socket to the interface
Change-Id: Icf7cf8147ceca5e27b7b923d520e2189741d9882
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-23 08:25:36 -03:00
Alin Jerpelea
0a6b1f55ab netutils: update licenses to Apache
Gregory Nutt is has submitted the SGA

Sebastien Lorquet has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 05:05:27 -05:00
Alin Jerpelea
ec339bc49a Makefiles: Gregory Nutt: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-07 21:35:33 -05:00
Xiang Xiao
1ee948e0c8 Include assert.h for DEBUGASSERT caller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:34:37 +09:00
chao.an
4c256e7db3 netutils/dhcpd: handshake the dhcpd message with server port.
resolve the dhcpd compatibility issues on some strict system, such as Windows XP,7,10

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-21 20:55:32 -07:00
Jiuzhu Dong
801acce04e dhcpd/telnet: don't need to dupcalite listen socket when task_create
N/A

Change-Id: Id0d613809c4caf902332b16daedebbe45acee7f2
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-19 08:21:27 +09:00
Dong Heng
208df89ab0 netutils/dhcpd: Fix printf format error based on different chip arches 2021-03-05 07:45:07 -08:00
Juha Niskanen
2a11d60246 netutils/ftpc: fix incorrect comments, nxstyle
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-13 11:14:43 -06:00
YAMAMOTO Takashi
e1cfa52efa netutils/dhcpd/dhcpd.c: Fix syslog formats 2020-11-26 19:28:14 -08:00
chao.an
8917467d04 netutils/dhcpd: correct the member name
Change-Id: I4dc6be8550a938851ae897fd93200a995e5c5178
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-07 14:16:14 -05:00
Xiang Xiao
deaa6c5b7b build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
and move NUTTXLIB defintion to the common place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 15:17:37 -03:00
Xiang Xiao
69f013e74e build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 15:56:35 +01:00
Xiang Xiao
ead498a788 build: Remove the workaround for the inexistence of .config/Make.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-21 17:43:42 +01:00
Xiang Xiao
3b98acc87c netutils/dhcpd: correct the option header check
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:51:55 -06:00
Xiang Xiao
ed3ac15526 netutils/dhcpd: Fix the minor typo error
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:51:55 -06:00
chao.an
7a9eea5aba netutils/dhcpd: fix nxstyle warning
Change-Id: I92c4c9426629c728c70b3f6bb047f218816580a2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-09 13:31:15 -06:00
chao.an
018c9420ac netutils/dhcpd: cancelable dhcp daemon
Change-Id: Iea3c0b8f91b0d6d8ececcd3932d8756a9d021608
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-09 13:31:15 -06:00
Xiang Xiao
1511403fdf Revert "Don't generate .depend anymore"
This reverts commit cc5ad09caa.
2020-03-22 23:09:40 -05:00
Xiang Xiao
cc5ad09caa
Don't generate .depend anymore 2020-03-22 18:15:21 +00:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Xiang Xiao
d660492289 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:41:36 -06:00
Xiang Xiao
e0dcfa0c55 Remove extra whitespace from files (#43)
* Remove multiple newlines at the end of file
* Remove the white space from the end of line
2020-01-31 08:29:24 -06:00
Xiang Xiao
db61c92100 Fix dhcpd #17
apps/netutils/dhcpd/dhcpd.c:  Fix unused const variable

dhcpd.c:273:29: warning: 'g_anyipaddr' defined but not used [-Wunused-const-variable=]
 static const uint8_t        g_anyipaddr[4] = {0, 0, 0, 0};

apps/netutils/dhcpd:  Make dhcpd interface configurable

apps/netutils/dhcpd:  Lease address directly if hit in address range

apps/netutils/netinit: Initialize dhcpc_state

update the addresses only on request success
2020-01-16 12:06:25 -06:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Gregory Nutt
9b77f80740 apps/netutils/dhcpd/dhcpd.c: Correct backward conditional logic in dhcpd_leaseexpired(). Noted by surya prakash <suryaec1684@gmail.com>. 2019-12-19 07:35:52 -06:00
Xiang Xiao
7808eb62d2 apps/: In all Make.def files, append to CONFIGURED_APPS patch with the absolute path. 2019-10-17 11:33:59 -06:00
Gregory Nutt
3a23523147 Makefiles: This reverts part of commit cf0365ea9. It restores 'conditional' inclusion of TOPDIR/Make.defs. Otherwise all make targets fail if the board has not been configured. That is okay most of the time, but not for things like clean and distclean which should not depend on being configured. 2019-10-15 09:25:48 +08:00
Xiang Xiao
cf0365ea92 Clean up Makefile under apps folder no functional changes. 2019-10-04 08:35:46 -06:00
Nathan Hartman
664e8a1410 Fix minor typos in docs and comments. 2019-09-29 12:53:39 -06:00
Anthony Merlino
87098590b5 Merged in antmerlino/apps/dhcpd-arp-fix (pull request #187)
netutils/dhcpd: Fixes bug where hwaddr was being used instead of ipaddr in the ARP update.

This bug seems to have been introduced 3 years ago during a rewrite to remove a direct OS call to arp. I'm not sure how others have not run into issues with this. The behavior I was observing was that the DHCPD would go to offer an IP address, but then send a ARP request for the IP instead because it didn't know where to send the data.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-07-26 01:52:57 +00:00
anchao
b5cfd93444 apps/: Modification to build system: Unified application compilation rules 2018-09-03 09:29:56 -06:00
EunBong Song
d0f74f5346 dhcpd: Prevent buffer overflow in dhcpd_addoption. offset represents distance from start of option buffer. So this should be changed current option pointer minus start of buffer. 2017-08-25 06:50:37 -06:00
Gregory Nutt
7a8561728c The last change added .PRECIOUS: $(BIN) to everyway Makefile in hopes the libapps.a will not be deleted on Control-C (unproven so far). However, $(BIN) may contain back slashes in some build platforms and that causes problems for make: It can't handle the backslashes in the .PRECIOUS dependency list. $(BIN) replaced with ../../libapp.a, where the number of ../ depends on the depth of the Makefile in the apps/ source tree. 2017-08-13 11:03:17 -06:00
Gregory Nutt
a66da34f18 All Makefiles: Add .PRECIOUS: apps/libapps.a to every Makefile. Hopefully this will end awkward problems when you Control-C out of a build and libapps.a is deleted. 2017-08-13 09:35:14 -06:00
Sebastien Lorquet
2cbad44f1d This is the Pokemon patch to change all includes fronm <apps/bla/bla.h> to "bla/bla.h" 2016-07-11 10:11:18 -06:00
Gregory Nutt
a50383db3d apps/graphics and netutils: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-14 17:53:47 -06:00
Gregory Nutt
586b0aa7e0 Change names of *dbg() * *err() 2016-06-11 15:51:27 -06:00
Gregory Nutt
344c92e2a4 Replace all occurrences of vdbg with vinfo 2016-06-11 11:55:38 -06:00
Sebastien Lorquet
bfff5e7179 Add empty preconfig rules to 'leaf' makefiles 2016-06-02 16:24:30 +02:00
Sebastien Lorquet
9a406515d7 make the full tree use wildcards make.defs 2016-06-02 16:21:21 +02:00
Gregory Nutt
5642e02f77 Fix some incorrect usage of INADDR_ANY 2016-02-09 11:24:30 -06:00
Gregory Nutt
85b5341d7b DHCPD no longer calls directly into the OS, but uses network IOCTL commands to modify the ARP table. 2016-02-08 12:07:47 -06:00
Gregory Nutt
f10f2de2e4 Eliminate some warnings 2015-09-08 09:20:49 -06:00
Gregory Nutt
ae57fd7ee2 Fix some warnings/errors detected by nuttx/tools/testbuilds.sh 2015-07-10 18:41:56 -06:00
Gregory Nutt
d5b6949c9f Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:14:53 -06:00
Gregory Nutt
5499189417 Add netlib and application hooks for ICMPv6 auto-configuration (still incomplete 2015-02-03 08:01:55 -06:00
Gregory Nutt
55bfbed33f Fixes for more issues found by cppcheck 2014-11-25 15:26:30 -06:00