diff options
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/aoe.c | 3 | ||||
| -rw-r--r-- | src/net/ipv6.c | 5 | ||||
| -rw-r--r-- | src/net/retry.c | 12 | ||||
| -rw-r--r-- | src/net/tcp.c | 2 | ||||
| -rw-r--r-- | src/net/tcp/ftp.c | 3 | ||||
| -rw-r--r-- | src/net/tcp/http.c | 3 | ||||
| -rw-r--r-- | src/net/tcp/https.c | 3 | ||||
| -rw-r--r-- | src/net/tcp/iscsi.c | 3 | ||||
| -rw-r--r-- | src/net/udp/dhcp.c | 17 | ||||
| -rw-r--r-- | src/net/udp/dns.c | 3 | ||||
| -rw-r--r-- | src/net/udp/tftp.c | 5 |
11 files changed, 52 insertions, 7 deletions
diff --git a/src/net/aoe.c b/src/net/aoe.c index fd82665d1..e3f84e5ae 100644 --- a/src/net/aoe.c +++ b/src/net/aoe.c @@ -31,6 +31,7 @@ #include <gpxe/ata.h> #include <gpxe/netdevice.h> #include <gpxe/process.h> +#include <gpxe/features.h> #include <gpxe/aoe.h> /** @file @@ -39,6 +40,8 @@ * */ +FEATURE ( FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1 ); + struct net_protocol aoe_protocol; /** List of all AoE sessions */ diff --git a/src/net/ipv6.c b/src/net/ipv6.c index c228f09c4..c07ff94cc 100644 --- a/src/net/ipv6.c +++ b/src/net/ipv6.c @@ -19,10 +19,7 @@ struct net_protocol ipv6_protocol; /* Unspecified IP6 address */ static struct in6_addr ip6_none = { - .in6_u.u6_addr32[0] = 0, - .in6_u.u6_addr32[1] = 0, - .in6_u.u6_addr32[2] = 0, - .in6_u.u6_addr32[3] = 0, + .in6_u.u6_addr32 = { 0,0,0,0 } }; /** An IPv6 routing table entry */ diff --git a/src/net/retry.c b/src/net/retry.c index 6734968f5..0f711e6d1 100644 --- a/src/net/retry.c +++ b/src/net/retry.c @@ -74,6 +74,18 @@ void start_timer ( struct retry_timer *timer ) { } /** + * Start timer with no delay + * + * @v timer Retry timer + * + * This starts the timer running with a zero timeout value. + */ +void start_timer_nodelay ( struct retry_timer *timer ) { + start_timer ( timer ); + timer->timeout = 0; +} + +/** * Stop timer * * @v timer Retry timer diff --git a/src/net/tcp.c b/src/net/tcp.c index 01daf75ab..28cf95fb3 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -232,7 +232,7 @@ static int tcp_open ( struct xfer_interface *xfer, struct sockaddr *peer, goto err; /* Start timer to initiate SYN */ - start_timer ( &tcp->timer ); + start_timer_nodelay ( &tcp->timer ); /* Attach parent interface, transfer reference to connection * list and return diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index 646638aba..0e4d969f1 100644 --- a/src/net/tcp/ftp.c +++ b/src/net/tcp/ftp.c @@ -11,6 +11,7 @@ #include <gpxe/xfer.h> #include <gpxe/open.h> #include <gpxe/uri.h> +#include <gpxe/features.h> #include <gpxe/ftp.h> /** @file @@ -19,6 +20,8 @@ * */ +FEATURE ( FEATURE_PROTOCOL, "FTP", DHCP_EB_FEATURE_FTP, 1 ); + /** * FTP states * diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c index 727c03334..2a5450eda 100644 --- a/src/net/tcp/http.c +++ b/src/net/tcp/http.c @@ -40,8 +40,11 @@ #include <gpxe/tcpip.h> #include <gpxe/process.h> #include <gpxe/linebuf.h> +#include <gpxe/features.h> #include <gpxe/http.h> +FEATURE ( FEATURE_PROTOCOL, "HTTP", DHCP_EB_FEATURE_HTTP, 1 ); + /** HTTP receive state */ enum http_rx_state { HTTP_RX_RESPONSE = 0, diff --git a/src/net/tcp/https.c b/src/net/tcp/https.c index 148e4bf01..15ab32ef8 100644 --- a/src/net/tcp/https.c +++ b/src/net/tcp/https.c @@ -27,6 +27,9 @@ #include <gpxe/open.h> #include <gpxe/tls.h> #include <gpxe/http.h> +#include <gpxe/features.h> + +FEATURE ( FEATURE_PROTOCOL, "HTTPS", DHCP_EB_FEATURE_HTTPS, 1 ); /** * Initiate an HTTPS connection diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index e64591713..ccb6cffe0 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -32,6 +32,7 @@ #include <gpxe/uaccess.h> #include <gpxe/tcpip.h> #include <gpxe/dhcp.h> +#include <gpxe/features.h> #include <gpxe/iscsi.h> /** @file @@ -40,6 +41,8 @@ * */ +FEATURE ( FEATURE_PROTOCOL, "iSCSI", DHCP_EB_FEATURE_ISCSI, 1 ); + /** iSCSI initiator name (explicitly specified) */ static char *iscsi_explicit_initiator_iqn; diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index f8f59e2e4..86695f12b 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -70,6 +70,10 @@ static uint8_t dhcp_request_options_data[] = { DHCP_END }; +/** DHCP feature codes */ +static uint8_t dhcp_features[0] __table_start ( uint8_t, dhcp_features ); +static uint8_t dhcp_features_end[0] __table_end ( uint8_t, dhcp_features ); + /** * Name a DHCP packet type * @@ -508,6 +512,7 @@ int create_dhcp_request ( struct net_device *netdev, int msgtype, struct dhcp_packet *dhcppkt ) { struct device_description *desc = &netdev->dev->desc; struct dhcp_netdev_desc dhcp_desc; + size_t dhcp_features_len; int rc; /* Create DHCP packet */ @@ -544,6 +549,16 @@ int create_dhcp_request ( struct net_device *netdev, int msgtype, } } + /* Add options to identify the feature list */ + dhcp_features_len = ( dhcp_features_end - dhcp_features ); + if ( ( rc = set_dhcp_packet_option ( dhcppkt, DHCP_EB_ENCAP, + dhcp_features, + dhcp_features_len ) ) != 0 ) { + DBG ( "DHCP could not set features list option: %s\n", + strerror ( rc ) ); + return rc; + } + /* Add options to identify the network device */ dhcp_desc.type = desc->bus_type; dhcp_desc.vendor = htons ( desc->vendor ); @@ -897,7 +912,7 @@ int start_dhcp ( struct job_interface *job, struct net_device *netdev, goto err; /* Start timer to initiate initial DHCPREQUEST */ - start_timer ( &dhcp->timer ); + start_timer_nodelay ( &dhcp->timer ); /* Attach parent interface, mortalise self, and return */ job_plug_plug ( &dhcp->job, job ); diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c index b141eea42..f32b2e055 100644 --- a/src/net/udp/dns.c +++ b/src/net/udp/dns.c @@ -31,6 +31,7 @@ #include <gpxe/retry.h> #include <gpxe/tcpip.h> #include <gpxe/dhcp.h> +#include <gpxe/features.h> #include <gpxe/dns.h> /** @file @@ -39,6 +40,8 @@ * */ +FEATURE ( FEATURE_PROTOCOL, "DNS", DHCP_EB_FEATURE_DNS, 1 ); + /** The DNS server */ static struct sockaddr_tcpip nameserver = { .st_port = htons ( DNS_PORT ), diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index 106c70475..7f1c4ce64 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -30,6 +30,7 @@ #include <gpxe/uri.h> #include <gpxe/tcpip.h> #include <gpxe/retry.h> +#include <gpxe/features.h> #include <gpxe/tftp.h> /** @file @@ -38,6 +39,8 @@ * */ +FEATURE ( FEATURE_PROTOCOL, "TFTP", DHCP_EB_FEATURE_TFTP, 1 ); + /** * A TFTP request * @@ -654,7 +657,7 @@ int tftp_open ( struct xfer_interface *xfer, struct uri *uri ) { goto err; /* Start timer to initiate RRQ */ - start_timer ( &tftp->timer ); + start_timer_nodelay ( &tftp->timer ); /* Attach to parent interface, mortalise self, and return */ xfer_plug_plug ( &tftp->xfer, xfer ); |
