Page MenuHomeFreeBSD

D32615.id97338.diff
No OneTemporary

D32615.id97338.diff

Index: sbin/route/route.c
===================================================================
--- sbin/route/route.c
+++ sbin/route/route.c
@@ -101,8 +101,8 @@
static uid_t uid;
static int defaultfib;
static int numfibs;
-static char domain[MAXHOSTNAMELEN + 1];
-static bool domain_initialized;
+static char domain_storage[MAXHOSTNAMELEN + 1];
+static const char *domain;
static int rtm_seq;
static char rt_line[NI_MAXHOST];
static char net_line[MAXHOSTNAMELEN + 1];
@@ -533,14 +533,14 @@
const char *cp;
int n;
- if (!domain_initialized) {
- domain_initialized = true;
- if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (cp = strchr(domain, '.'))) {
- domain[MAXHOSTNAMELEN] = '\0';
- (void)strcpy(domain, cp + 1);
- } else
- domain[0] = '\0';
+ if (domain == NULL) {
+ if (gethostname(domain_storage, MAXHOSTNAMELEN) == 0 &&
+ (cp = strchr(domain_storage, '.')) != NULL) {
+ domain = cp + 1;
+ } else {
+ domain_storage[0] = '\0';
+ domain = domain_storage;
+ }
}
/* If the address is zero-filled, use "default". */

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 9, 1:14 AM (7 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38552066
Default Alt Text
D32615.id97338.diff (1 KB)

Event Timeline