forked from Imagelibrary/rtems
Let TCP/IP stack pick port rather than hard coding selection. Correction of 2008-09-23.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-09-25 Eric Norum <norume@aps.anl.gov>
|
||||||
|
|
||||||
|
* libnetworking/lib/rtems_bsdnet_ntp.c: Let TCP/IP stack pick port
|
||||||
|
rather than hard coding selection. Correction of 2008-09-23.
|
||||||
|
|
||||||
2008-09-24 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2008-09-24 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
PR 1326/cpukit
|
PR 1326/cpukit
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ tryServer (int i, int s, rtems_bsdnet_ntp_callback_t callback, void *usr_data)
|
|||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
memset (&farAddr, 0, sizeof farAddr);
|
memset (&farAddr, 0, sizeof farAddr);
|
||||||
farAddr.sin_family = AF_INET;
|
farAddr.sin_family = AF_INET;
|
||||||
farAddr.sin_port = htons (0);
|
farAddr.sin_port = htons (123);
|
||||||
farAddr.sin_addr = rtems_bsdnet_ntpserver[i];
|
farAddr.sin_addr = rtems_bsdnet_ntpserver[i];
|
||||||
memset (&packet, 0, sizeof packet);
|
memset (&packet, 0, sizeof packet);
|
||||||
packet.li_vn_mode = (3 << 3) | 3; /* NTP version 3, client */
|
packet.li_vn_mode = (3 << 3) | 3; /* NTP version 3, client */
|
||||||
@@ -171,7 +171,7 @@ int ret;
|
|||||||
}
|
}
|
||||||
memset (&myAddr, 0, sizeof myAddr);
|
memset (&myAddr, 0, sizeof myAddr);
|
||||||
myAddr.sin_family = AF_INET;
|
myAddr.sin_family = AF_INET;
|
||||||
myAddr.sin_port = htons (123);
|
myAddr.sin_port = htons (0);
|
||||||
myAddr.sin_addr.s_addr = htonl (INADDR_ANY);
|
myAddr.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||||
if (bind (s, (struct sockaddr *)&myAddr, sizeof myAddr) < 0) {
|
if (bind (s, (struct sockaddr *)&myAddr, sizeof myAddr) < 0) {
|
||||||
fprintf (stderr, "rtems_bsdnet_get_ntp() Can't bind socket: %s\n", strerror (errno));
|
fprintf (stderr, "rtems_bsdnet_get_ntp() Can't bind socket: %s\n", strerror (errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user